import { useRef } from "react";
import { QueryPage } from "@components";
import Details from "./components/details";

import { fields, GetColumns } from "./config";

import { findEmerNotifierInner } from "@apis/emergencyInformApi";

const EmergencyInform = () => {
  const detailsRef = useRef("detailsRef");

  const queryFormRef = useRef("queryFormRef");
  const formProps = {
    formRef: queryFormRef,
    fields: fields
  };

  const tableProps = {
    rowKey: "emerMasterId",
    columns: GetColumns(detailsRef),
  };

  return (
    <>
      <QueryPage
        formProps={formProps}
        tableProps={tableProps}
        queryApi={findEmerNotifierInner}
        showModal={false}
      />

      <Details detailsRef={detailsRef} />
    </>
  );
};

export default EmergencyInform;
